package com.uraurora.crescent.function;

import java.util.Objects;

public interface Action7<T1, T2, T3, T4, T5, T6, T7> {

    void on(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7);

    default Action7<T1, T2, T3, T4, T5, T6, T7> before(Action7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7> before) {
        Objects.requireNonNull(before);
        return (T1 t1,T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) -> { before.on(t1, t2, t3, t4, t5, t6, t7); on(t1, t2, t3, t4, t5, t6, t7); };
    }

    default Action7<T1, T2, T3, T4, T5, T6, T7> after(Action7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7> after) {
        Objects.requireNonNull(after);
        return (T1 t1,T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7) -> { on(t1, t2, t3, t4, t5, t6, t7); after.on(t1, t2, t3, t4, t5, t6, t7); };
    }

    //<editor-fold desc="柯里化与反柯里化">
    default Action6<T2, T3, T4, T5, T6, T7> curry1(T1 t1){
        return (t2, t3, t4, t5, t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action6<T1, T3, T4, T5, T6, T7> curry2(T2 t2){
        return (t1, t3, t4, t5, t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action6<T1, T2, T4, T5, T6, T7> curry3(T3 t3){
        return (t1, t2, t4, t5, t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action6<T1, T2, T3, T5, T6, T7> curry4(T4 t4){
        return (t1, t2, t3, t5, t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action6<T1, T2, T3, T4, T6, T7> curry5(T5 t5){
        return (t1, t2, t3, t4, t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action6<T1, T2, T3, T4, T5, T7> curry6(T6 t6){
        return (t1, t2, t3, t4, t5, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action6<T1, T2, T3, T4, T5, T6> curry7(T7 t7){
        return (t1, t2, t3, t4, t5, t6) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action5<T3, T4, T5, T6, T7> curry(T1 t1, T2 t2){
        return (t3, t4, t5, t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action4<T4, T5, T6, T7> curry(T1 t1, T2 t2, T3 t3){
        return (t4, t5, t6, t7)->on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action3<T5, T6, T7> curry(T1 t1, T2 t2, T3 t3, T4 t4){
        return (t5, t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action2<T6, T7> curry(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5){
        return (t6, t7) -> on(t1, t2, t3, t4, t5, t6, t7);
    }

    default Action1<T7> curry(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6){
        return t7 -> on(t1, t2, t3, t4, t5, t6, t7);
    }
    //</editor-fold>

}
